<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改短信模板')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-template-edit" th:object="${baseNoteTemplate}">
            <input name="idNoteTemplate" th:field="*{idNoteTemplate}" type="hidden">
            <input type="hidden" id="naNoteCls" name="naNoteCls"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">通知分类：</label>
                <div class="col-sm-8">
                    <select name="sdNoteCls" id="sdNoteCls" class="form-control m-b" th:with="type=${@baseSd.getItem('note_class')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"  th:field="*{sdNoteCls}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">编码：</label>
                <div class="col-sm-8">
                    <input name="cd" th:field="*{cd}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">内容：</label>
                <div class="col-sm-8">
                    <textarea class="form-control" name="cont" rows="10" th:text="*{cont}"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="des" th:field="*{des}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "base/note/template";
        $("#form-template-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            var naCls = $("#sdNoteCls").find("option:selected").text();
            $("#naNoteCls").val(naCls);
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-template-edit').serialize());
            }
        }
    </script>
</body>
</html>